package com.ruoyi.school.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.school.mapper.IndexImageMapper;
import com.ruoyi.school.domain.IndexImage;
import com.ruoyi.school.service.IIndexImageService;

/**
 * 首页图片Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-03
 */
@Service
public class IndexImageServiceImpl implements IIndexImageService 
{
    @Autowired
    private IndexImageMapper indexImageMapper;

    /**
     * 查询首页图片
     * 
     * @param imageId 首页图片主键
     * @return 首页图片
     */
    @Override
    public IndexImage selectIndexImageByImageId(Long imageId)
    {
        return indexImageMapper.selectIndexImageByImageId(imageId);
    }

    /**
     * 查询首页图片列表
     * 
     * @param indexImage 首页图片
     * @return 首页图片
     */
    @Override
    public List<IndexImage> selectIndexImageList(IndexImage indexImage)
    {
        return indexImageMapper.selectIndexImageList(indexImage);
    }

    /**
     * 新增首页图片
     * 
     * @param indexImage 首页图片
     * @return 结果
     */
    @Override
    public int insertIndexImage(IndexImage indexImage)
    {
        indexImage.setCreateTime(DateUtils.getNowDate());
        return indexImageMapper.insertIndexImage(indexImage);
    }

    /**
     * 修改首页图片
     * 
     * @param indexImage 首页图片
     * @return 结果
     */
    @Override
    public int updateIndexImage(IndexImage indexImage)
    {
        indexImage.setUpdateTime(DateUtils.getNowDate());
        return indexImageMapper.updateIndexImage(indexImage);
    }

    /**
     * 批量删除首页图片
     * 
     * @param imageIds 需要删除的首页图片主键
     * @return 结果
     */
    @Override
    public int deleteIndexImageByImageIds(Long[] imageIds)
    {
        return indexImageMapper.deleteIndexImageByImageIds(imageIds);
    }

    /**
     * 删除首页图片信息
     * 
     * @param imageId 首页图片主键
     * @return 结果
     */
    @Override
    public int deleteIndexImageByImageId(Long imageId)
    {
        return indexImageMapper.deleteIndexImageByImageId(imageId);
    }
}
